<template>
	<view>
		 <SortPickerList ref="sortPickerList" @clickData="clickData"></SortPickerList>
	</view>
</template>

<script>
	import SortPickerList from "@/components/nickro-sortPickerList/nickro-sortPickerList.vue"
	export default {
		components:{
            SortPickerList
        },
        data() {
            return {
                //示例数据
                dataArr: [],
			}
		},
		onLoad() {
			uni.startPullDownRefresh();
		},
		onPullDownRefresh() {
			console.log('refresh');
			setTimeout(function () {
				uni.stopPullDownRefresh();
			}, 1000);
		},
		onShow() {
			var that = this
			uni.setNavigationBarTitle({
                    title: '请注意多音字'
            });
		},
		onReady() {
			var that = this
			this.$http.post("/user/queryBankName",{
				SIGNATURE : uni.getStorageSync('SIGNATURE'),
				TOKEN: uni.getStorageSync('userInfo').TOKEN,
			}).then(e=>{
				e.data.OBJECT.map(item=>{
					item.name=item.BANKNAME;
					item.value=item.BANKID;
					that.dataArr.push(item)
				})
				that.$refs["sortPickerList"].initPage(that.dataArr)
			})
		},
		methods: {
			clickData(data) {
				uni.$emit('login',{
					BANKNAME:data.label,
					ID:data.value,
				});
				uni.navigateBack();
			},
		}
	}
</script>

<style>

</style>
